﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace weikebuluo.Common
{
    /// <summary>
    /// RegexHelper 的摘要说明
    /// </summary>
    public class RegexHelper
    {
        public RegexHelper()
        { }

        /// <summary>
        /// 获取参数值
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public static string getQueryString(string input, string name)
        {
            string result = "";

            if (!string.IsNullOrEmpty(input) && !string.IsNullOrEmpty(name))
            {
                result = (new Regex(@"" + name + "=(?<" + name + ">[^&]*)", RegexOptions.IgnoreCase)).Match(input).Groups[name].Value;
            }

            return result;
        }
    }
}
